<style lang="scss" scoped>
.app-container {
    >p {
        opacity: 1;
        margin: 0 0 0 20px;
        /** 文本1 */
        font-size: 18px;
        font-weight: 400;
        color: rgba(17, 38, 60, 1);
        border-left: 3px solid rgba(84, 91, 245, 1);
        padding-left: 10px;
        margin-bottom: 15px;
        margin-left: 0;
    }

    .header {
        min-height: 55px;
        opacity: 1;
        border-radius: 10px;
        background: rgba(255, 255, 255, 1);
        box-shadow: 0px 20px 45px rgba(240, 237, 246, 0.5);
        margin-bottom: 15px;
        // padding: 10px 20px;

        >p {

            opacity: 1;
            margin: 0 0 0 20px;
            /** 文本1 */
            font-size: 18px;
            font-weight: 400;
            color: rgba(17, 38, 60, 1);
            border-left: 3px solid rgba(84, 91, 245, 1);
            padding-left: 10px;
            margin-bottom: 15px;
            margin-left: 0;
        }

        .images {
            display: flex;
            justify-content: space-between;
            padding: 0 100px;

            .item {
                text-align: center;

                p {
                    margin-top: 5px;
                    opacity: 1;
                    font-size: 16px;
                    font-weight: 400;
                    letter-spacing: 0px;
                    line-height: 24px;
                    color: rgba(156, 159, 167, 1);
                    text-align: center;
                    vertical-align: top;

                }

                h1 {
                    font-size: 30px;
                    margin: 10px;
                }
            }
        }



    }


    .content {
        opacity: 1;
        border-radius: 10px;
        background: rgba(255, 255, 255, 1);
        padding: 20px;

        .con_header {
            display: flex;
            justify-content: space-between;

            >p {
                opacity: 1;
                margin: 0 0 0 20px;
                /** 文本1 */
                font-size: 18px;
                font-weight: 400;
                color: rgba(17, 38, 60, 1);
                border-left: 3px solid rgba(84, 91, 245, 1);
                padding-left: 10px;
                margin-bottom: 15px;
                margin-left: 0;
            }

            .el-button {
                height: 32px;
                opacity: 1;
                border-radius: 2px;
                background: linear-gradient(268.09deg, rgba(96, 103, 250, 1) 0%, rgba(119, 153, 252, 1) 100%);
                padding: 8px 18px;
                color: #fff;
                border: none;
                margin-left: 25px;

                &:hover {
                    border: none;
                    background: linear-gradient(268.09deg, rgb(69, 78, 255) 0%, rgb(88, 130, 255) 100%);

                }



            }
        }

        .el-tabs {
            margin-left: 30px;

            ::v-deep .el-tabs__item {
                color: rgba(188, 195, 212, 1);
                font-size: 14px;
            }

            ::v-deep .is-active {
                color: rgba(94, 129, 244, 1) !important;
                opacity: 1;
                /** 文本1 */
                font-size: 15px;
                font-weight: 700;
                letter-spacing: 0px;
                color: rgba(94, 129, 244, 1);
            }

            ::v-deep .el-tabs__active-bar {
                background-color: rgba(94, 129, 244, 1) !important;
            }
        }

        .description-cell {
            .cell-content {
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                overflow: hidden;
                text-overflow: ellipsis;
                line-height: 1.6em;
                max-height: 3.2em;
            }
        }



        ::v-deep .el-table {
            font-size: 12px;

            .el-tooltip__popper.is-dark {
                white-space: normal;
                max-width: 200px;
                /* 或者其他合适的宽度 */
            }
        }

        ::v-deep .el-table .el-table__header-wrapper th,
        ::v-deep .el-table .el-table__fixed-header-wrapper th {
            height: 41px !important;
            opacity: 1;
            border-radius: 10px 10px, 0px, 0px;
            background: rgba(83, 90, 244, 0.1);

            /** 文本1 */
            font-size: 13px;
            font-weight: 500;
            letter-spacing: 0px;
            line-height: 11.72px;
            color: rgba(83, 90, 244, 1);
            vertical-align: top;

        }

        .status {
            display: block;
            padding: 3px 0px;
            opacity: 0.9;
            border-radius: 5px;
            font-size: 11px;
            text-align: center;
            transition: opacity 0.3s ease-in-out;
        }

        .status:hover {
            opacity: 1;
        }

        .status-unsold-recovered {
            color: rgb(159, 100, 223);
            /* 红色 */
            background-color: rgba(244, 235, 253, 1)
                /* 浅红色 */
        }

        .status-unsold-exception {
            color: #FF9800;
            /* 橙色 */
            background-color: #FFF3E0;
            /* 浅橙色 */
        }

        .status-sold-recovered {
            color: rgb(137, 64, 233);
            background-color: rgb(223, 241, 255);
        }

        .status-sold-exception {
            color: #F44336;
            /* 亮红色 */
            background-color: #FFEBEE;
            /* 浅红色 */
        }

        .status-sold-change-binding {
            color: #2196F3;
            /* 蓝色 */
            background-color: #E3F2FD;
            /* 浅蓝色 */
        }




    }

}

::v-deep .el-dialog {
    width: 849px;
    opacity: 1;
    border-radius: 30px;
    background: rgba(255, 255, 255, 1);

    .avatar-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        overflow: hidden;
    }

    .avatar-uploader .el-upload:hover {
        border-color: #409EFF;
    }

    .avatar-uploader-icon {
        font-size: 28px;
        color: #8c939d;
        width: 178px;
        height: 178px;
        line-height: 178px;
        text-align: center;
    }

    .avatar {
        width: 178px;
        height: 178px;
        display: block;
    }

    p {
        opacity: 1;
        margin: 0 0 0 20px;
        /** 文本1 */
        font-size: 18px;
        font-weight: 400;
        color: rgba(17, 38, 60, 1);
        border-left: 3px solid rgba(84, 91, 245, 1);
        padding-left: 10px;
        margin-bottom: 15px;
        margin-left: 0;
    }

    .el-input {
        width: 165px;

        .el-input__inner {
            width: 165px;
            border: 1px solid rgba(127, 127, 213, 0.5);
            border-radius: 10px;
        }
    }

    .el-button {
        width: 60px;
        height: 32px;
        opacity: 1;
        border-radius: 2px;
        background: linear-gradient(268.09deg, rgba(96, 103, 250, 1) 0%, rgba(119, 153, 252, 1) 100%);
        padding: 8px 16px 8px 16px;
        color: #fff;
        border: none;
        margin-left: 25px;

        &:hover {
            border: none;
            background: linear-gradient(268.09deg, rgb(69, 78, 255) 0%, rgb(88, 130, 255) 100%);

        }

        &:nth-child(2) {
            width: 60px;
            height: 32px;
            opacity: 1;
            border-radius: 2px;
            background: rgba(242, 243, 245, 1);
            color: rgba(0, 0, 0, 0.3);
            padding: 8px 16px 8px 16px;

            &:hover {
                border: none;
                background: rgb(228, 228, 228);

            }
        }


    }

    .el-input-number {
        width: 165px;

        .el-input {
            width: 165px;

            .el-input__inner {
                width: 165px;
                border: 1px solid rgba(127, 127, 213, 0.5);
                border-radius: 0px;
            }
        }
    }

    .el-dialog__title {
        border-left: 3px solid rgba(84, 91, 245, 1);
        padding-left: 8px;

    }

}
</style>
<template>
    <div class="app-container">
        <p>异常管理</p>
        <div class="header">
            <p>问题账号实时数据</p>
            <div class="images">
                <div class="item">
                    <img src="../../../assets/images/分组 2.png" alt="">
                    <p>今日异常已处理</p>
                    <h1>{{ TodayCount }}</h1>
                </div>
                <div class="item">
                    <img src="../../../assets/images/分组 3.png" alt="">
                    <p>未售找回</p>
                    <h1>{{ status.UnsoldRecovered || 0 }}</h1>
                </div>
                <div class="item">
                    <img src="../../../assets/images/分组 4.png" alt="">
                    <p>已售找回</p>
                    <h1>{{ status.SoldRecovered || 0 }}</h1>
                </div>
                <div class="item">
                    <img src="../../../assets/images/分组 6.png" alt="">
                    <p>已售未换绑</p>
                    <h1>{{ status.SoldChangeBinding || 0 }}</h1>
                </div>
                <div class="item">
                    <img src="../../../assets/images/分组 6.png" alt="">
                    <p>已售异常</p>
                    <h1>{{ status.SoldException || 0 }}</h1>
                </div>
                <div class="item">
                    <img src="../../../assets/images/分组 6.png" alt="">
                    <p>未售异常</p>
                    <h1>{{ status.UnsoldException || 0 }}</h1>
                </div>

            </div>
        </div>

        <el-row :gutter="20" style="margin-top: 8px;">
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                <div class="header">
                    <p>异常金额汇总</p>
                    <div class="images" style="padding: 0 56px;">

                        <div class="item">
                            <img src="../../../assets/images/分组 3.png" alt="">
                            <p>未售找回金额</p>
                            <h1>{{ status.UnsoldRecovered || 0 }}</h1>
                        </div>
                        <div class="item">
                            <img src="../../../assets/images/分组 6.png" alt="">
                            <p>未售异常金额</p>
                            <h1>{{ status.UnsoldException || 0 }}</h1>
                        </div>
                        <div class="item">
                            <img src="../../../assets/images/分组 6.png" alt="">
                            <p>已售异常金额</p>
                            <h1>{{ status.SoldChangeBinding || 0 }}</h1>
                        </div>
                        <div class="item">
                            <img src="../../../assets/images/分组 4.png" alt="">
                            <p>已售找回金额</p>
                            <h1>{{ status.SoldRecovered || 0 }}</h1>
                        </div>
                    </div>
                </div>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                <div class="header">
                    <p>昨日已处理异常</p>
                    <div class="images" style="padding: 0 56px;">

                        <div class="item">
                            <img src="../../../assets/images/分组 3.png" alt="">
                            <p>未售找回</p>
                            <h1>{{ status.UnsoldRecovered || 0 }}</h1>
                        </div>

                        <div class="item">
                            <img src="../../../assets/images/分组 6.png" alt="">
                            <p>未售异常</p>
                            <h1>{{ status.SoldException || 0 }}</h1>
                        </div>
                        <div class="item">
                            <img src="../../../assets/images/分组 4.png" alt="">
                            <p>已售找回</p>
                            <h1>{{ status.SoldRecovered || 0 }}</h1>
                        </div>
                    </div>
                </div>
            </el-col>
        </el-row>

        <div class="content">
            <div class="con_header">
                <p>异常管理</p>
                <el-button type="warning" plain size="mini" @click="handleExport"
                    v-hasPermi="['business:stock:export']">导出</el-button>
            </div>



            <el-tabs v-model="activeGame" @tab-click="handleGame">
                <el-tab-pane label="全部" name=""></el-tab-pane>
                <el-tab-pane label="未售找回" name="UnsoldRecovered"></el-tab-pane>
                <el-tab-pane label="未售异常" name="UnsoldException"></el-tab-pane>
                <el-tab-pane label="已售找回" name="SoldRecovered"></el-tab-pane>
                <el-tab-pane label="已售异常" name="SoldException"></el-tab-pane>
                <el-tab-pane label="已售未换绑" name="SoldChangeBinding"></el-tab-pane>
            </el-tabs>
            <el-table v-loading="loading" :data="managementList" @selection-change="handleSelectionChange" stripe>
                <el-table-column label="编号" align="center" width="50">
                    <template slot-scope="scope">
                        {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
                    </template>
                </el-table-column>
                <el-table-column label="绑定手机" align="center" width="110">
                    <template slot-scope="scope">
                        <span v-if="scope.row.phoneNumber == null" style="color: red;">已解绑</span>
                        <span v-else>{{ scope.row.phoneNumber }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="手机编号" align="center" width="80">
                    <template slot-scope="scope">
                        <span v-if="scope.row.phoneCode == null" style="color: red;">暂无</span>
                        <span v-else>{{ scope.row.phoneCode }}</span>
                    </template>
                </el-table-column>

                <!-- <el-table-column label="销售渠道" align="center" width="80">
                    <template slot-scope="scope">
                        <span v-if="scope.row.phoneCode == null" style="color: red;">暂无</span>
                        <span v-else>{{ scope.row.phoneCode }}</span>
                    </template>
                </el-table-column> -->
                <!--
                <el-table-column label="销售编号" align="center" width="80">
                    <template slot-scope="scope">
                        <span v-if="scope.row.phoneCode == null" style="color: red;">暂无</span>
                        <span v-else>{{ scope.row.phoneCode }}</span>
                    </template>
                </el-table-column> -->

                <el-table-column label="销售渠道" align="center" prop="saleChannel" />

                <el-table-column label="销售编号" align="center" prop="saleId" />




                <el-table-column label="状态" align="center" prop="status" width="90">
                    <template slot-scope="scope">
                        <span v-if="scope.row.problemType == 'UnsoldRecovered'"
                            class="status status-unsold-recovered">未售找回</span>
                        <span v-if="scope.row.problemType == 'UnsoldException'"
                            class="status status-unsold-exception">未售异常</span>
                        <span v-if="scope.row.problemType == 'SoldRecovered'"
                            class="status status-sold-recovered">已售找回</span>
                        <span v-if="scope.row.problemType == 'SoldException'"
                            class="status status-sold-exception">已售异常</span>
                        <span v-if="scope.row.problemType == 'SoldChangeBinding'"
                            class="status status-sold-change-binding">已售未换绑</span>
                    </template>
                </el-table-column>
                <el-table-column label="账号描述" width="200" class-name="description-cell">
                    <template v-slot="scope">
                        <el-popover trigger="hover" placement="top" class="custom-popover">
                            <p style="white-space: normal; max-width: 400px;">{{ scope.row.accountDescription }}</p>
                            <div slot="reference" class="cell-content">{{ scope.row.accountDescription }}</div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column label="账号" align="center" prop="account" />
                <el-table-column label="密码" align="center" prop="password" />
                <el-table-column label="销售金额" align="center" prop="saleAmount" />
                <el-table-column label="回收金额" align="center" prop="recycleAmount" />
                <el-table-column label="回收渠道" align="center" prop="recycleChannelName" />
                <el-table-column label="换绑客服" align="center" prop="changeName" />
                <el-table-column label="回收客服" align="center" prop="recycleName" />
                <el-table-column label="回收编号" align="center" prop="orderNumber" />
                <!-- <el-table-column label="异常原因" align="center" width="80">
                    <template slot-scope="scope">
                        <span v-if="scope.row.phoneCode == null" style="color: red;">暂无</span>
                        <span v-else>{{ scope.row.phoneCode }}</span>
                    </template> -->
                <el-table-column label="异常原因" align="center" prop="abnormityReason">
                </el-table-column>
                <el-table-column label="入库时间" align="center" prop="storageTime">
                    <template slot-scope="scope">
                        <span>{{ parseTime(scope.row.storageTime, '{y}-{m}-{d}') }}</span>
                    </template>
                </el-table-column>
                <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button size="mini" type="text" @click="handleUpdate(scope.row)"
                            v-hasPermi="['business:stock:notation']">
                            <span style="color: rgba(83, 90, 244, 1);margin-right: 5px;">恢复入库</span>
                        </el-button>

                        <el-popconfirm v-if="scope.row.problemType == 'SoldException'" title="您确定完结出库吗？"
                            @confirm="submitFormNotation(scope.row)">
                            <el-button slot="reference" size="mini" type="text" v-hasPermi="['business:stock:question']">
                                <span style="color: rgba(83, 90, 244, 1);">完结出库</span>
                            </el-button>
                        </el-popconfirm>
                        <el-button v-else size="mini" type="text" @click="handleNotation(scope.row)"
                            v-hasPermi="['business:stock:question']">
                            <span style="color: rgba(83, 90, 244, 1);margin-right: 5px">完结出库 </span>
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>

            <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize" @pagination="getList" />
        </div>
    </div>
</template>

<script>
import { notation, upload, getManagement, delManagement, addManagement, unboundPhonesByCategory } from "@/api/business/staylnventory";
import { listManagement, getStatistics, returnStorage, completeCheckout } from "@/api/business/abnormal";

export default {
    name: "Management",
    data() {
        return {
            //状态数据
            TodayCount: '',
            status: {},
            dialogImageUrl: '',
            dialogVisible: false,
            //销售渠道
            saleChannelList: [],
            //库存状态列表
            stockStatusList: [],
            //绑定手机列表
            phoneList: [],
            //换绑客服
            changeList: [],
            //回收客服
            recycleList: [],
            //销售客服
            sellList: [],
            //二次实名
            secondaryRealNameList: [],
            //回收列表
            recycleChannelList: [],
            //渠道列表
            bindingChannelList: [],
            //区服列表
            regionList: [
                { label: '3936区', value: '3936' }
            ],
            //游戏列表
            gameList: [],
            activeGame: '',
            // 遮罩层
            loading: false,
            // 选中数组
            ids: [],
            // 非单个禁用
            single: true,
            // 非多个禁用
            multiple: true,
            // 显示搜索条件
            showSearch: true,
            // 总条数
            total: 0,
            // 表格数据
            managementList: [
                {}
            ],
            // 弹出层标题
            title: "",
            // 是否显示新增弹出层
            open: false,
            // 是否显示提号弹出层
            openNotation: false,
            // 是否显示转问题弹出层
            openProblem: false,
            //当前绑定的手机号和渠道
            bindingChannelId: '',
            phoneData: {
                phoneCode: null,
                phoneId: null,
                phoneNumber: null
            },
            // 查询参数
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                phoneNumber: null,
                accountDescription: null,
                account: null,
                recycleChannelId: null,
                orderNumber: null,
                status: null,
            },
            // 表单参数
            form: {},
            // 提号表单参数
            formNotation: {
                orderRemark: '未追回赔付订单'
            },
            // 表单校验
            rules: {
                bindingChannelId: [
                    { required: true, message: "绑定类目不能为空", trigger: "change" }
                ],
                phoneId: [
                    { required: true, message: "绑定手机不能为空", trigger: "change" }
                ],
                expenditureAccount: [
                    { required: true, message: "支出金额不能为空", trigger: "blur" }
                ],
                incomeAccount: [
                    { required: true, message: "收入金额不能为空", trigger: "blur" }
                ]
            },

        };
    },
    created() {

        this.getList();

        //查询游戏列字典
        this.getDicts('game_category').then(res => {
            this.gameList = res.data
        })
        //查询绑定渠道字典
        this.getDicts('binding_channel').then(res => {
            this.bindingChannelList = res.data
        })
        //查询回收渠道字典
        this.getDicts('recycle_channel').then(res => {
            this.recycleChannelList = res.data
        })
        //查询二次实名字典
        this.getDicts('secondary_real_name').then(res => {
            this.secondaryRealNameList = res.data
        })
        //查询状态字典
        this.getDicts('stock_status').then(res => {
            this.stockStatusList = res.data
        })
        //查询销售渠道
        this.getDicts('sale_channel').then(res => {
            this.saleChannelList = res.data
        })
        //查询回收客服
        this.passPost('recycle').then(res => {
            this.recycleList = res.data
        })
        //查询换绑客服
        this.passPost('change').then(res => {
            this.changeList = res.data
        })
        //查询销售客服
        this.passPost('sell').then(res => {
            this.sellList = res.data
        })
    },

    methods: {
        handleAvatarSuccess(response, file) {
            // 假设服务器响应的数据中包含了文件路径 'url'
            this.form.images = response.url; // 更新 form.image 为服务器返回的 URL
        },
        beforeAvatarUpload(file) {
            // 这里可以添加上传前的逻辑，例如检查文件类型或文件大小
            const isJPG = file.type === 'image/jpeg';
            const isPNG = file.type === 'image/png';
            const isLt2M = file.size / 1024 / 1024 < 2;

            if (!isJPG && !isPNG) {
                this.$message.error('上传头像图片只能是 JPG/PNG 格式!');
                return false;
            }
            return true; // 如果检查通过，返回 true
        },
        //选中分类事件
        changeChannel(value) {
            this.form.phoneId = null
            this.form.phoneCode = null
            this.bindingChannelList.forEach(item => {
                if (item.dictCode == value) {
                    unboundPhonesByCategory(item.dictValue)
                        .then(res => {
                            this.phoneList = res.data
                            if (this.bindingChannelId == value) {
                                this.phoneList.unshift(this.phoneData)
                            }
                        })
                    return
                }
            })
        },

        //切换Tab
        handleGame(tab, event) {
            this.queryParams.problemType = tab.name
            this.getList()
        },
        /** 查询列表 */
        getList() {
            this.loading = true;
            getStatistics()
                .then(res => {
                    console.log(res)
                    this.status = res.data
                    this.TodayCount = res.data.TodayCount
                })
            listManagement(this.queryParams).then(response => {
                this.managementList = response.rows;
                this.total = response.total;
                this.loading = false;
            });

        },
        /** 修改按钮操作 */
        handleUpdate(row) {
            console.log('row', row);
            this.reset();
            let bindingChannelId = ''
            let obj = {
                phoneCode: row.phoneCode,
                phoneId: row.phoneId,
                phoneNumber: row.phoneNumber,
            }

            this.bindingChannelList.forEach(item => {
                if (item.dictValue == row.phoneField) {
                    bindingChannelId = item.dictCode
                }
            })

            unboundPhonesByCategory(row.phoneField)
                .then(res => {
                    this.phoneList = res.data
                    this.phoneData = obj
                    if (!this.phoneList.find(item => item.phoneId == this.phoneData.phoneId)) {
                        this.phoneList.unshift(this.phoneData)
                    }
                })
            this.bindingChannelId = bindingChannelId
            this.form = {
                ...row,
                bindingChannelId,
                realNameId: Number(row.realNameId),
                dictCodeId: Number(row.dictCodeId)
            }

            console.log('form', this.form);
            this.open = true;
            this.title = "恢复入库";
        },
        //新增 取消按钮
        cancel() {
            this.open = false;
            this.reset();
        },
        //新增 表单重置
        reset() {
            this.form = {
                phoneCode: null,
                phoneId: null
            };
            this.resetForm("form");
        },
        /** 新增按钮操作 */
        handleAdd() {
            this.reset();
            this.open = true;
            this.title = "新增账号";
        },
        /** 新增 确认提交 */
        submitForm() {
            console.log('this.form', this.form);
            this.$refs["form"].validate(valid => {
                if (valid) {
                    if (this.form.id != null) {
                        returnStorage(this.form).then(response => {
                            this.$modal.msgSuccess("恢复入库成功");
                            this.open = false;
                            this.getList();
                        });
                    } else {
                        addManagement(this.form).then(response => {
                            this.$modal.msgSuccess("新增成功");
                            this.open = false;
                            this.getList();
                        });
                    }
                }
            });
        },


        //提号 取消按钮
        cancelNotation() {
            this.openNotation = false;
            this.resetNotation();
        },
        //提号 表单重置
        resetNotation() {
            this.formNotation = {};
            this.resetForm("formNotation");
        },
        /** 提号按钮操作 */
        handleNotation(row) {
            this.resetNotation();
            this.openNotation = true
            this.formNotation = {
                ...row,
                orderRemark: '未追回赔付订单',
                category: '找回赔付',
                saleAmount: row.saleAmount,


            }
        },
        /** 提号 确认提交 */
        submitFormNotation(row) {

            if (row) {
                this.formNotation = {
                    ...row
                }
            }
            console.log(this.formNotation);
            completeCheckout(this.formNotation).then(response => {
                this.$modal.msgSuccess("成功");
                this.openNotation = false;
                this.getList();
            });

        },

        //转问题 取消按钮
        cancelProblem() {
            this.openProblem = false;
            this.resetProblem();
        },
        //转问题 表单重置
        resetProblem() {
            this.formProblem = {
            };
            this.resetForm("formProblem");
        },
        /** 转问题按钮操作 */
        handleDelete(row) {
            this.resetQuery();
            const id = row.id
            this.openProblem = true
        },
        /** 转问题 确认提交 */
        submitFormProblem() {
            // console.log('this.formNotation', this.formNotation);
            // this.$refs["formNotation"].validate(valid => {
            //   if (valid) {
            //     notation(this.form).then(response => {
            //       this.$modal.msgSuccess("提号成功");
            //       this.openNotation = false;
            //       this.getList();
            //     });

            //   }
            // });
        },
        /** 搜索按钮操作 */
        handleQuery() {
            this.queryParams.pageNum = 1;
            this.getList();
        },
        /** 重置按钮操作 */
        resetQuery() {
            this.$refs.queryForm.resetFields();
            this.handleQuery();
        },
        // 多选框选中数据
        handleSelectionChange(selection) {
            this.ids = selection.map(item => item.id)
            this.single = selection.length !== 1
            this.multiple = !selection.length
        },


        /** 导出按钮操作 */
        handleExport() {
            this.download('business/stock/export', {
                ...this.queryParams
            }, `management_${new Date().getTime()}.xlsx`)
        }
    }
};
</script>
